<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.fredck.FCKeditor.*"  %>
<%@ taglib uri="/FCKeditor" prefix="FCK" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
  

    <head>
    <script type="text/javascript" src="../js_editer/fckeditor.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <style type="text/css">@import url(../css/jquery-calendar.css);</style>
    <script type="text/javascript" src="../js/jquery-calendar.js"></script>
    <script type="text/javascript" src="../js/jquery-calendar-zh-cn.js"></script>
    <script type="text/javascript">
    
	$(document).ready(function(){
       
		$("#addnews_btn").click(function(){
			var re = true;
			var alertText = "";
			var newsTitle = $("#kaishiriqi").attr("value");
			var remnantstr = $("#remnant").attr("value");
			if((newsTitle == undefined)||(newsTitle == null)){
				$("#kaishiriqi").css("background-color","#FF9");
				alertText += "请输入日期" + "\n";}
			if((remnantstr == undefined)||(remnantstr == null)){			
				$("#remnant").css("background-color","#FF9");
				alertText += "请输入余位数量" + "\n";
			}else{
				var str = remnantstr;
				var mynumber="0123456789";
				var result = "";
				for(var i=0;i<str.length;i++){ 
					var c=str.charAt(i); 
					if(mynumber.indexOf(c)==-1){ 
						result = "请正确输入余位数量";		
						$("#remnant").css("background-color","#FF9");
					}
				}
				alertText += result;
			}
			if(alertText != ""){
				alert(alertText);
				return false;
			}else{
					$("#createUserForm").submit();
			}
		})
		$('#kaishiriqi').calendar({autoPopUp: 'both', buttonImageOnly: true,
		buttonImage: '../img/calendar.gif', buttonText: 'Calendar', yearRange: '-5:+5'});
		$("#kaishiriqi").change(function(){
			$(this).css("background-color","#FFF");
			});
		$("#remnant").change(function(){
			$(this).css("background-color","#FFF");
			});
    }); 
    </script>
<title>添加余位信息</title>
<link href="../css/mngMain.css" type="text/css" rel="stylesheet" />
</head>

  <body>
<div class="controlBox">
	<%@include file="../admin_top.jsp" %>
	<div class="mngMain">
		<div class="mngLeft">
			 <%@include file="../admin_menu.jsp" %>
		</div>
		<div class="mngRight">
			<div class="mngRightContainer">
				<div class="mngRightContainerT">添加余位信息</div>
				<div class="mngRightContainerM">
				<font color="red">${info}</font>
				<html:form action="addSeat.do" styleId="createUserForm" method="post" enctype="multipart/form-data">								
					<table>		
						<tr>
							<th>线路：</th>
						  	<td>	
											<select name="parId" id="newsType_jq" style="width:152px" >
												<logic:notEmpty name="lineList">
													<logic:iterate id="line" name="lineList">													
														<option value="${line.lineId}"><logic:notEmpty name="line" property="serialNumber">(${line.serialNumber})</logic:notEmpty>${line.lineName}&nbsp;[${line.parentName}]</option>
													</logic:iterate>
												</logic:notEmpty>
											</select></td>
						</tr>
						<tr>
							<th>日期：</th>
						  	<td><input type="text" name="dateAsString" id="kaishiriqi" /><span> *</span></td>
						</tr>
						<tr>
							<th>余位：</th>
						  	<td><input type="text" id="remnant" name="remnant" /></td>
						</tr>
						<tr>
							<td><input type="button" value="发布" src="../img/submitBtn.gif" id="addnews_btn" /></td>
							<td><input type="button" value="返回管理页" src="../img/submitBtn.gif" onclick="javascript:window.location.href('manageSeat.do');" /></td>
						</tr>
					</table>
					</html:form>
				</div>
			</div>
		</div>
	</div>
	<div class="mngBottom">
		<div class="mngLine"></div>
	</div>
</div>
</body>
</html>
